enum ScoreStatus {
  EXCEPTION = 0,
  NORMAL = 1,
  REVIEWING = 2,
}

const ScoreTextMap = {
  [ScoreStatus.NORMAL]: '正常',
  [ScoreStatus.EXCEPTION]: '异常',
  [ScoreStatus.REVIEWING]: '审核中',
};

type AntdStatus = 'default' | 'success' | 'processing' | 'error' | 'warning';

const ScoreTagStatusMap: Record<ScoreStatus, AntdStatus> = {
  [ScoreStatus.NORMAL]: 'success',
  [ScoreStatus.EXCEPTION]: 'error',
  [ScoreStatus.REVIEWING]: 'processing',
};

const getTextByStatus = (status: number): string => {
  const text = ScoreTextMap[status as keyof typeof ScoreTextMap];
  return text ?? '未知状态';
};

const getTagStatusByStatus = (status: number): string => {
  return ScoreTagStatusMap[status as keyof typeof ScoreTagStatusMap];
};

export { AntdStatus, ScoreStatus, ScoreTextMap, getTagStatusByStatus, getTextByStatus };
